package com.itheima.health.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Configuration//这是一个配置类
public class CommonConfig {
    @PostConstruct
    public void init(){

    }
    //初始化，需要注入容器中的某个数据
    @Resource
    public void aaaa(RedisTemplate redisTemplate) {
    }
        @Bean
        public BCryptPasswordEncoder bCryptPasswordEncoder(){
            return new BCryptPasswordEncoder();
        }

}
